package com.jiuyin.dianjing.ui.activity.match;

import android.content.Intent;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.jiuyin.dianjing.R;
import com.jiuyin.dianjing.app.HelperApplication;
import com.jiuyin.dianjing.ui.activity.base.BaseActivity;

import butterknife.BindView;
import butterknife.OnClick;

import static com.jiuyin.dianjing.api.constant.ApiConstant.KEY_ADDRESS;
import static com.jiuyin.dianjing.api.constant.ApiConstant.KEY_BONUS_RULE;
import static com.jiuyin.dianjing.api.constant.ApiConstant.KEY_NAME;
import static com.jiuyin.dianjing.api.constant.ApiConstant.KEY_TACTICS;
import static com.jiuyin.dianjing.api.constant.ApiConstant.KEY_TIME;

/**
 * 团队申请参赛
 */
public class MatchTeamEnterActivity extends BaseActivity {
    @BindView(R.id.tv_event_name_value)
    TextView mEventName;
    @BindView(R.id.tv_match_type_value)
    TextView mMatchType;
    @BindView(R.id.tv_match_time_value)
    TextView mMatchTime;
    @BindView(R.id.tv_match_address_value)
    TextView mMatchAddress;
    @BindView(R.id.tv_match_event_rewards_value)
    TextView mMatchRewards;
    @BindView(R.id.tv_match_apply_user_value)
    TextView mMatchUser;
    @BindView(R.id.tv_match_create_contact_information_value)
    TextView mMatchInformation;
    @BindView(R.id.edt_match_apply_game_id)
    EditText mMatchGameId;

    @Override
    protected int setLayoutId() {
        return R.layout.activity_apply_match_team_enter;
    }

    @Override
    protected void initData() {
        Intent intent = getIntent();
        if (null != intent) {
            String name = intent.getStringExtra(KEY_NAME);
            String matchName = intent.getStringExtra(KEY_TACTICS);
            String time = intent.getStringExtra(KEY_TIME);
            String address = intent.getStringExtra(KEY_ADDRESS);
            String rule = intent.getStringExtra(KEY_BONUS_RULE);
            mEventName.setText(name);
            mMatchType.setText(matchName);
            mMatchTime.setText(time);
            mMatchAddress.setText(address);
            mMatchRewards.setText(rule);
            mMatchUser.setText(HelperApplication.getNickName());
            mMatchInformation.setText(HelperApplication.getMobile());
        }
    }

    @Override
    protected void initView() {
        setTitle(R.string.match_apply_entry_team);
    }


    @OnClick({R.id.bt_submit})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.bt_submit:
                submit();
                break;
            default:
                break;
        }
    }

    private void submit() {

    }
}
